package com.carpark.ejb.Model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Piotr
 */
@Entity
@Table(name = "sites")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SitesModel.findAll", query = "SELECT s FROM SitesModel s"),
    @NamedQuery(name = "SitesModel.findById", query = "SELECT s FROM SitesModel s WHERE s.id = :id"),
    @NamedQuery(name = "SitesModel.findBySite", query = "SELECT s FROM SitesModel s WHERE s.site = :site")})
public class SitesModel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 2147483647)
    @Column(name = "Html")
    private String html;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "Site")
    private String site;

    public SitesModel() {
    }

    public SitesModel(Integer id) {
        this.id = id;
    }

    public SitesModel(Integer id, String html, String site) {
        this.id = id;
        this.html = html;
        this.site = site;
    }
    
    public SitesModel(String html, String site) {
        this.html = html;
        this.site = site;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getHtml() {
        return html;
    }

    public void setHtml(String html) {
        this.html = html;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof SitesModel)) {
            return false;
        }
        SitesModel other = (SitesModel) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.carpark.ejb.Model.SitesModel[ id=" + id + " ]";
    }
    
}
